<template>
	<view class="container">
		<view class="flex justify-between align-center padding margin-bottom-xs bg-white" v-for="item in list">
			<view class="">
				<view class="text-15 text-221815">
					<block>{{item.typeName}}</block>
				</view>
				<view class="text-sm text-999 margin-top-xs">
					{{item.createTime}}
				</view>
			</view>
			<view class="text-17 text-221815 text-bold">
				<text v-if='item.amount>0'
					style="color: red;">{{'+'+ parseFloat(item.amount/ 100).toFixed(2)         }}</text>
				<text v-else style="color: #000000;">{{parseFloat(item.amount/ 100).toFixed(2) }}</text>
			</view>
		</view>
		<uni-load-more :status="loading" />
	</view>
</template>

<script>
	import BetterPull from '@/common/util/BetterPull'
	export default {
		mixins: [
			BetterPull({
				async getPage(page, done) {
					this.loading = 'loading';

					const obj = {
						pageNum: page,
						pageSize: 10,
						userId: uni.getStorageSync('userId')

					}
					const [err, res] = await this.$get(this.$api.accountList,
						obj)
					if (res) {
						var data = res.data.list
						done(data);
						if (data.length < 10) {
							this.loading = 'noMore';
						} else {
							this.loading = 'more';
						}

					}
					if (err) {
						done([]);
						this.loading = 'noMore';
					}
				}
			})
		],
		data() {
			return {
				loading: 'more',
			};
		}
	}
</script>

<style lang="scss" scoped>

</style>
